<div id="leftField">
  <div id="displayResult">
    <table border="0" cellspacing="0">
      <?php 
        $difficult = array(
          0=>"新手",
          1=>"初级",
          2=>"初中",
          3=>"中级",
          4=>"高级",
          5=>"厨神"
        );
        $usergroup = 0;
        if (isset($_SESSION['usergroup']))
          $usergroup = $_SESSION['usergroup'];

        foreach ($posts as $post):
      ?>
      <tr class="resultItem">
        <td class="userLogo">
            <?php
              echo $this->Html->link($this->Html->Image(
                $post['User']['url'],
                array('width'=>'60')),
                array('controller'=>'users','action' => 'userCenter', $post['User']['id']),
                array('escape' => false));
            ?>
        </td>
        <td>
          <div class="recipeItem">
            <?php echo $this->Html->image('list.png',array('class'=>'list')); ?>

            <a class="recipeItemImageWrap"><img class="recipeItemImage" src="<?php echo $post['Recipe']['img']; ?>"/></a>
            <?php echo $this->Html->link('<div class="recipeItemTitle">'.$post['Recipe']['name'].'</div>',array('controller'=>'recipes','action' => 'details', $post['Recipe']['id']),array('escape'=>false)); ?>
            <div class="recipeItemStar">(评级：
              <?php
                echo $post['Recipe']['currentScore']*2;?>)</div>
            <?php
              if ($usergroup == 1) echo '<div class="operation">'.$this->Html->link(
                '删除',
                array('controller'=>'recipes',
                'action' => 'delete',
                $post['Recipe']['id']),
                array(),
                '确定删除么？'
              ).'|'.$this->Html->link(
              '修改', 
              array('controller'=>'users',
              'action' => 'modifyRecipe',
              $post['Recipe']['id'])).'</div>'
            ?>
            <div class="recipeItemDescription"><?php echo $post['Recipe']['description']; ?></div>
            
            
            <div class="recipeItemTags">标签
            <?php 
              $tag_array = explode(" ",$post['Recipe']['tags']);
            $number = count($tag_array);
            for($i = 0; $i < $number; $i++){
              echo "<a>".$tag_array[$i]."</a>";
            }
        ?></div>
            <hr class="clearFix"/>
            <div class="recipeItemTaste">口味：<a><?php echo $post['Recipe']['taste']; ?></a></div>
            <div class="recipeItemMethod">工艺：<a><?php echo $post['Recipe']['method']; ?></a></div>
            <div class="recipeItemDifficulty">难度：<a><?php echo $difficult[$post['Recipe']['difficulty']]; ?></a></div>
            <div class="recipeItemComment">评论(<a><?php echo $post['Recipe']['commentsNumber']; ?></a>)</div>
          </div>
        </td>
      </tr>
      <?php endforeach; ?>
    </table>
    <?php 
      echo $this->element('paginator');
    ?>
  </div>
  <div id=""></div>
</div>